Failed Conditions
Pull Request — master (#2)
by Yo
01:38
created

taskLogger.js ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.512

Importance

Changes 7
Bugs 0 Features 0
Metric Value
cc 1
c 7
b 0
f 0
nc 1
nop 2
dl 0
loc 5
rs 9.4285
ccs 1
cts 5
cp 0.2
crap 1.512
1
"use strict";
2
3 1
const wrapper = require('./wrapper');
4 1
const BaseLogger = require('./EnhancedLogger');
5
6
class TaskLogger extends BaseLogger {
7
8
    constructor(taskName, wrapper) {
9
        super(wrapper);
10
11 2
        this.taskName = taskName;
12
    }
13
14
    starting() {
15
        this.info(' Starting ...');
16
    }
17
18
    stopping() {
19
        this.info(' Stopping ...');
20
    }
21
22
    started() {
23
        this.info(' Started');
24
    }
25
26
    stopped() {
27
        this.info(' Stopped');
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    normalizeMessage(message, meta = {}) {// eslint-disable-line no-unused-vars
1 ignored issue
show
Unused Code introduced by
The parameter meta is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
34
        return `[${this.taskName}]${message}`;
35
    }
36
}
37
38
/**
39
 * @param {string} taskName
40
 *
41
 * @return {TaskLogger} Logger for a task
42
 */
43 1
module.exports = taskName => new TaskLogger(taskName, wrapper);
44
45